home *** CD-ROM | disk | FTP | other *** search
/ Hacker's Arsenal - The Cutting Edge of Hacking / Hacker's Arsenal - The Cutting Edge of Hacking.iso / texts / gtmhh / gtmhh3-2.txt < prev    next >
Encoding:
Text File  |  2002-01-31  |  29.8 KB  |  623 lines

  1. ____________________________________________________________
  2.  
  3. GUIDE TO (mostly) HARMLESS HACKING
  4.  
  5. Vol. 3 Number 2
  6.  
  7. How to map the Internet. Dig! Whois! Nslookup! Traceroute! Netstat port 
  8. is getting hard to use anymore, however...
  9. ______________________________________________________________
  10. Why map the Internet?
  11. * Because itÆs fun -- like exploring unknown continents. The Internet is 
  12. so huge, and it changes so fast, no one has a complete map.
  13. * Because when you canÆt make contact with someone in a distant place, 
  14. you can help your ISP trouble shoot broken links in the Internet. Yes, I 
  15. did that once that when email failed to a friend in Northern Ireland. 
  16. How will your ISP know that their communications provider is lying down 
  17. on the job unless someone advises them of trouble?
  18. * Because if you want to be a computer criminal, your map of the 
  19. connections to your intended victim gives you valuable information.
  20. Now since this is a lesson on *legal* hacking, weÆre not going to help 
  21. you out with how to determine the best box in which to install a sniffer 
  22. or how to tell what IP address to spoof to get past a packet filter. 
  23. WeÆre just going to explore some of the best tools available for mapping 
  24. the uncharted realms of the Internet. 
  25. For this lesson, you can get some benefit even if all you have is 
  26. Windows. But to take full advantage of this lesson, you should either 
  27. have some sort of Unix on your personal computer, or a shell account! 
  28. SHELL ACCOUNT! If you donÆt have one, you may find an ISP that will give 
  29. you a shell account at http://www.celestin.com/pocia/.
  30. ****************************
  31. Newbie note: A shell account is an account with your ISP that allows you 
  32. to give commands on a computer running Unix. The ôshellö is the program 
  33. that translates your keystrokes into Unix commands. Trust me, if you are 
  34. a beginner, you will find bash (for Bourne again shell) to be easiest to 
  35. use. Ask tech support at your ISP for a shell account set up to use 
  36. bash. Or, you may be able to get the bash shell by simply typing the 
  37. word ôbashö at the prompt. If your ISP doesnÆt offer shell accounts, get 
  38. a new ISP that does offer it. A great book on using the bash shell is 
  39. _Learning the Bash Shell_, by Cameron Newham and Bill Rosenblatt, 
  40. published by OÆReilly.
  41. ****************************
  42. So for our mapping expedition, letÆs start by visiting the Internet in 
  43. Botswana! Wow, is Botswana even on the Internet? ItÆs a lovely 
  44. landlocked nation in the southern region of Africa, famous for cattle 
  45. ranching, diamonds and abundant wildlife. The language of commerce in 
  46. Botswana is English, so thereÆs a good chance that we could understand 
  47. messages from their computers.
  48. Our first step in learning about BotswanaÆs Internet hosts is to use the 
  49. Unix program nslookup. 
  50. ****************************
  51. Evil genius tip: Nslookup is one of the most powerful Internet mapping 
  52. tools in existence. We can hardly do it justice here. If you want to 
  53. learn how to explore to the max, get the book _DNS and BIND_ by Paul 
  54. Albitz and Cricket Liu, published by OÆReilly, 1997 edition.
  55. ***************************
  56. The first step may be to find where your ISP has hidden the program by 
  57. using the command ôwhereis nslookup.ö (Or your computer may use the 
  58. ôfindö command.) Aha -- there it is! I give the command:
  59. ->/usr/etc/nslookup
  60. Default Server: swcp.com
  61. Address: 198.59.115.2
  62. >
  63. These two lines and the slightly different prompt (it isnÆt an arrow any 
  64. more) tell me that my local ISP is running this program for me. (It is 
  65. possible to run nslookup on another computer from yours.) Now we are in 
  66. the program, so I have to remember that my bash commands donÆt work any 
  67. more. Our next step is to tell the program that we would like to know 
  68. what computers handle any given domain name.
  69. > set type=ns 
  70. Next we need to know the domain name for Botswana. To do that I look up 
  71. the list of top level domain names on page 379 of the 1997 edition of 
  72. _DNS and BIND_. For Botswana itÆs bw. So I enter it at the prompt, 
  73. remembering -- this is VERY important -- to put a period after the 
  74. domain name:
  75. > bw. 
  76. Server: swcp.com
  77. Address: 198.59.115.2
  78. Non-authoritative answer:
  79. This ônon-authoritative answerö stuff tells me that this information has 
  80. been stored for awhile, so it is possible, but unlikely, that the 
  81. information below has changed.
  82. bw nameserver = DAISY.EE.UND.AC.ZA
  83. bw nameserver = RAIN.PSG.COM
  84. bw nameserver = NS.UU.NET
  85. bw nameserver = HIPPO.RU.AC.ZA
  86. Authoritative answers can be found from:
  87. DAISY.EE.UND.AC.ZA inet address = 146.230.192.18
  88. RAIN.PSG.COM inet address = 147.28.0.34
  89. NS.UU.NET inet address = 137.39.1.3
  90. HIPPO.RU.AC.ZA inet address = 146.231.128.1
  91. I look up the domain name ôzaö and discover it stands for South Africa. 
  92. This tells me that the Internet is in its infancy in Botswana -- no 
  93. nameservers there -- but must be well along in South Africa. Look at all 
  94. those nameservers! 
  95. ***********************
  96. Newbie note: a nameserver is a computer program that stores data on the 
  97. Domain Name System. The Domain Name System makes sure that no two 
  98. computers have the same name. It also stores information on how to find 
  99. other computers. When various nameservers get to talking with each 
  100. other, they eventually, usually within seconds, can figure out the 
  101. routes to any one of the millions of computers on the Internet.
  102. ***********************
  103. Well, what this tells me is that people who want to set up Internet host 
  104. computers in Botswana usually rely on computers in South Africa to 
  105. connect them. LetÆs learn more about South Africa. Since we are still in 
  106. the nslookup program, I command it to tell me what computers are 
  107. nameservers for South Africa:
  108. > za.
  109. Server: swcp.com
  110. Address: 198.59.115.2
  111. Non-authoritative answer:
  112. za nameserver = DAISY.EE.UND.AC.za
  113. za nameserver = UCTHPX.UCT.AC.za
  114. za nameserver = HIPPO.RU.AC.za
  115. za nameserver = RAIN.PSG.COM
  116. za nameserver = MUNNARI.OZ.AU
  117. za nameserver = NS.EU.NET
  118. za nameserver = NS.UU.NET
  119. za nameserver = UUCP-GW-1.PA.DEC.COM
  120. za nameserver = APIES.FRD.AC.za
  121. Authoritative answers can be found from:
  122. DAISY.EE.UND.AC.za inet address = 146.230.192.18
  123. UCTHPX.UCT.AC.za inet address = 137.158.128.1
  124. HIPPO.RU.AC.za inet address = 146.231.128.1
  125. RAIN.PSG.COM inet address = 147.28.0.34
  126. MUNNARI.OZ.AU inet address = 128.250.22.2
  127. MUNNARI.OZ.AU inet address = 128.250.1.21
  128. NS.EU.NET inet address = 192.16.202.11
  129. UUCP-GW-1.PA.DEC.COM inet address = 204.123.2.18
  130. UUCP-GW-1.PA.DEC.COM inet address = 16.1.0.18
  131. APIES.FRD.AC.za inet address = 137.214.80.1
  132. ***********************
  133. Newbie note: What is inet address = 137.214.80.1 supposed to mean? 
  134. ThatÆs the name of a computer on the Internet (inet) -- in this case 
  135. APIES.FRD.AC -- in octal. Octal is like regular numbers except in base 8 
  136. rather than base 10. All computer names on the Internet must be changed 
  137. into numbers so that other computers can understand them.
  138. **********************
  139. Aha! Some of those nameservers are located outside South Africa. We see 
  140. computers in Australia (au) and the US (com domain). Next, we exit the 
  141. nslookup program with the command ^D. ThatÆs made by holding down the 
  142. control key while hitting the small ôdö key. It is VERY IMPORTANT to 
  143. exit nslookup this way and not with ^C.
  144. Next, we take one of the nameservers in South Africa and ask:
  145. ->whois HIPPO.RU.AC.ZA
  146. [No name] (HIPPO)
  147. Hostname: HIPPO.RU.AC.ZA
  148. Address: 146.231.128.1
  149. System: SUN running SUNOS
  150. Domain Server
  151. Record last updated on 24-Feb-92.
  152. To see this host record with registered users, repeat the command with
  153. a star ('*') before the name; or, use '%' to show JUST the registered 
  154. users.
  155. The InterNIC Registration Services Host contains ONLY Internet 
  156. Information
  157. (Networks, ASN's, Domains, and POC's).
  158. Please use the whois server at nic.ddn.mil for MILNET Information.
  159. Kewl! This tells us what kind of computer it is -- a Sun -- and the 
  160. operating system, Sun OS.
  161. Now, just for variety, I use the whois command with the numerical 
  162. address of one of the nameservers. This doesnÆt always give back the 
  163. text name, but sometimes it works. And, voila, we get:
  164. ->whois 146.230.192.18
  165. [No name] (DAISY1)
  166. Hostname: DAISY.EE.UND.AC.ZA
  167. Address: 146.230.192.18
  168. System: HP-9000 running HP-UX
  169. Domain Server
  170. Record last updated on 14-Sep-94.
  171. Ah, but all this is doing so far is just telling us info about who is a 
  172. nameserver for whom. Now how about directly mapping a route from my 
  173. computer to South Africa? For that we will use the traceroute command.
  174. ************************
  175. Netiquette tip: The traceroute program is intended for use in network 
  176. testing, measurement and management. It should be used primarily for 
  177. manual fault isolation, like the time I couldnÆt email my friend in 
  178. Northern Ireland. Because of the load it could impose on the network, it 
  179. is unwise to use traceroute from automated scripts which could cause 
  180. that program to send out huge numbers of queries. Use it too much and 
  181. your ISP may start asking you some sharp questions.
  182. ************************
  183. ************************
  184. YOU COULD GO TO JAIL WARNING: If you just got an idea of how to use 
  185. traceroute for a denial of service attack, donÆt call your favorite 
  186. journalist and tell him or her that you are plotting a denial of service 
  187. attack against the ISPs that serve famous people like Bill Clinton and 
  188. Carolyn Meinel!:-) DonÆt write that script. DonÆt use it. If you do, 
  189. IÆll give another interview to PC World magazine 
  190. (http://www.pcworld.com/news/newsradio/meinel/index.html) about how a 
  191. three-year-old could run the attack. And if you get caught weÆll all 
  192. laugh at you as you get hustled off in chains while your journalist 
  193. friend gets a $250K advance on his or her book deal about you.
  194. ************************
  195. I give the command:
  196. ->whereis traceroute
  197. traceroute: /usr/local/bin/traceroute
  198. OK, now weÆre ready to map in earnest. I give the command:
  199. ->/usr/local/bin/traceroute DAISY.EE.UND.AC.ZA
  200. And the answer is:
  201. traceroute to DAISY.EE.UND.AC.ZA (146.230.192.18), 30 hops max, 40 byte 
  202. packets
  203. 1 sisko (198.59.115.1) 3 ms 4 ms 4 ms
  204. 2 glory-cyberport.nm.westnet.net (204.134.78.33) 47 ms 8 ms 4 ms
  205. 3 ENSS365.NM.ORG (129.121.1.3) 5 ms 10 ms 7 ms
  206. 4 h4-0.cnss116.Albuquerque.t3.ans.net (192.103.74.45) 17 ms 41 ms 28 ms
  207. 5 f2.t112-0.Albuquerque.t3.ans.net (140.222.112.221) 7 ms 6 ms 5 ms
  208. 6 h14.t16-0.Los-Angeles.t3.ans.net (140.223.17.9) 31 ms 39 ms 84 ms
  209. 7 h14.t8-0.San-Francisco.t3.ans.net (140.223.9.13) 67 ms 43 ms 68 ms
  210. 8 enss220.t3.ans.net (140.223.9.22) 73 ms 58 ms 54 ms
  211. 9 sl-mae-w-F0/0.sprintlink.net (198.32.136.11) 97 ms 319 ms 110 ms
  212. 10 sl-stk-1-H11/0-T3.sprintlink.net (144.228.10.109) 313 ms 479 ms 473 
  213. ms
  214. 11 sl-stk-2-F/T.sprintlink.net (198.67.6.2) 179 ms * *
  215. 12 sl-dc-7-H4/0-T3.sprintlink.net (144.228.10.106) 164 ms * 176 ms
  216. 13 sl-dc-7-F/T.sprintlink.net (198.67.0.1) 143 ms 129 ms 134 ms
  217. 14 gsl-dc-3-Fddi0/0.gsl.net (204.59.144.197) 135 ms 152 ms 130 ms
  218. 15 204.59.225.66 (204.59.225.66) 583 ms 545 ms 565 ms
  219. 16 * * *
  220. 17 e0.csir00.uni.net.za (155.232.249.1) 516 ms 436 ms 400 ms
  221. 18 s1.und00.uni.net.za (155.232.70.1) 424 ms 485 ms 492 ms
  222. 19 e0.und01.uni.net.za (155.232.190.2) 509 ms 530 ms 459 ms
  223. 20 s0.und02.uni.net.za (155.232.82.2) 650 ms * 548 ms
  224. 21 Gw-Uninet1.CC.und.ac.za (146.230.196.1) 881 ms 517 ms 478 ms
  225. 22 cisco-unp.und.ac.za (146.230.128.8) 498 ms 545 ms *
  226. 23 IN.ee.und.ac.za (146.230.192.18) 573 ms 585 ms 493 ms
  227. So what does all this stuff mean?
  228. The number in front of each line is the number of hops since leaving the 
  229. computer that has the shell account I am using.
  230. The second entry is the name of the computer through which this route 
  231. passes, first in text, and then in parentheses its numerical 
  232. representation.
  233. The numbers after that are the time in milliseconds it takes for each of 
  234. three probe packets in a row to make that hop. When an * appears, the 
  235. time for the hop timed out. In the case of this traceroute command, any 
  236. time greater than 3 seconds causes an * to be printed out. 
  237. How about hop 16? It gave us no info whatsoever. That silent gateway may 
  238. be the result of a bug in the 4.1, 4.2 or 4.3BSD Unix network code. A 
  239. computer running one of these operating systems sends an ôunreachableö 
  240. message. Or it could be something else. Sorry, IÆm not enough of a 
  241. genius yet to figure out this one for sure. Are we having phun yet?
  242. ************************
  243. Evil genius tip: If you want to get really, truly excruciating detail on 
  244. the traceroute command, while in your shell account type in the command:
  245. ->man traceroute
  246. I promise, on-line manual stuff is often written in a witty, 
  247. entertaining fashion. Especially the Sun OS manual. Honest!
  248. ************************
  249. ************************
  250. Note for the shell-account-challenged: If you have Windows 95, you can 
  251. get the same results -- I mean, for mapping the Internet, not going to 
  252. jail -- using the ôtracertö command. HereÆs how it works:
  253. 1. Open a PPP connection. For example, if you use Compuserve or AOL, 
  254. make a connection, then minimize your on-line access program.
  255. 2. Click on the Start menu. 
  256. 3. Open a DOS window.
  257. 4. At the DOS prompt type in ôtracert where ôdistant.computer.comö is 
  258. replaced by the name of the computer to which you want to trace a route. 
  259. Press the Enter key.
  260. 5. Be patient. Especially if your are tracing a route to a distant 
  261. computer, it takes awhile to make all the connections. Every time your 
  262. computer connects to another computer on the Internet, it first has to 
  263. trace a route to the other computer. ThatÆs why it sometimes take a long 
  264. while for your browser to start downloading a Web page.
  265. 6. If you decide to use Windows for this hacking lesson, Damien Sorder 
  266. has a message for us: ôDON'T ENCOURAGE THEM TO USE WIN95!@#$!@#!ö HeÆs 
  267. right, but since most of you reading this are consenting adults, I 
  268. figure itÆs your funeral if you stoop to Windows hacking on an AOL PPP 
  269. connection!
  270. ***********************
  271. Now this is getting interesting. We know that Daisy is directly 
  272. connected to at least one other computer, and that computer in turn is 
  273. connected to cisco-unp.und.ac.za. LetÆs learn a little something about 
  274. this cisco-unp.und.ac.za, OK? 
  275. First, we can guess from the name that is it a Cisco router. In fact, 
  276. the first hop in this route is to a computer named ôsisco,ö which is 
  277. also probably a Cisco router. Since 85% of the routers in the world are 
  278. Ciscos, thatÆs a pretty safe bet. But we are going to not only make sure 
  279. cisco-unp.und.ac.za is a Cisco. We are also going to find out the model 
  280. number, and a few other goodies.
  281. First we try out whois:
  282. ->whois cisco-unp.und.ac.za
  283. No match for "CISCO-UNP.UND.AC.ZA".
  284. The InterNIC Registration Services Host contains ONLY Internet 
  285. Information
  286. (Networks, ASN's, Domains, and POC's).
  287. Please use the whois server at nic.ddn.mil for MILNET Information.
  288. Huh? Traceroute tells us cisco-unp.und.ac.za exists, but whois canÆt 
  289. find it! Actually this is a common problem, especially trying to use 
  290. whois on distant computers. What do we do next? Well, if you are lucky, 
  291. the whereis command will turn up another incredibly cool program: dig! 
  292. **********************
  293. Newbie note: Dig stands for ôdomain information groper.ö It does a lot 
  294. of the same things as nslookup. But dig is a much older program, in many 
  295. ways harder to use than nslookup. For details on dig, use the command 
  296. from your shell account ôman dig.ö
  297. **********************
  298. In fact, on my shell account I found I could run dig straight from my 
  299. bash prompt:
  300. ->dig CISCO-UNP.UND.AC.ZA
  301. ; <<>> DiG 2.0 <<>> CISCO-UNP.UND.AC.ZA
  302. ;; res options: init recurs defnam dnsrch
  303. ;; got answer:
  304. ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 6
  305. ;; flags: qr aa rd ra; Ques: 1, Ans: 4, Auth: 5, Addit: 5
  306. ;; QUESTIONS:
  307. ;; CISCO-UNP.UND.AC.ZA, type = A, class = IN
  308. ;; ANSWERS:
  309. CISCO-UNP.UND.AC.ZA. 86400 A 146.230.248.1
  310. CISCO-UNP.UND.AC.ZA. 86400 A 146.230.12.1
  311. CISCO-UNP.UND.AC.ZA. 86400 A 146.230.60.1
  312. CISCO-UNP.UND.AC.ZA. 86400 A 146.230.128.8
  313. ;; AUTHORITY RECORDS:
  314. und.ac.za. 86400 NS Eagle.und.ac.za.
  315. und.ac.za. 86400 NS Shrike.und.ac.za.
  316. und.ac.za. 86400 NS ucthpx.uct.ac.za.
  317. und.ac.za. 86400 NS hiPPo.ru.ac.za.
  318. und.ac.za. 86400 NS Rain.psg.com.
  319. ;; ADDITIONAL RECORDS:
  320. Eagle.und.ac.za. 86400 A 146.230.128.15
  321. Shrike.und.ac.za. 86400 A 146.230.128.13
  322. ucthpx.uct.ac.za. 86400 A 137.158.128.1
  323. hiPPo.ru.ac.za. 86400 A 146.231.128.1
  324. Rain.psg.com. 14400 A 147.28.0.34
  325. ;; Total query time: 516 msec
  326. ;; FROM: llama to SERVER: default -- 198.59.115.2
  327. ;; WHEN: Fri Jan 17 13:03:49 1997
  328. ;; MSG SIZE sent: 37 rcvd: 305
  329. Ahhh, nice. The first few lines, the ones preceded by the ;; marks, 
  330. mostly tell what the default settings of the command are and what we 
  331. asked it. The line ôQues: 1, Ans: 4, Auth: 5, Addit: 5ö tells us how 
  332. many items weÆll get under each topic of questions, answers, authority 
  333. records, and additional records. (You will get different numbers on that 
  334. line with different queries.) This ôrecordsö stuff refers to information 
  335. stored under the domain name system.
  336. We learn from dig is that CLASS=IN, meaning CISCO-UNP.UND.AC.ZA is a 
  337. domain name within the Internet. But we already knew that . The first 
  338. really *new* thing we learn is that four routers all share the same 
  339. domain name. We can tell that because their numerical Internet numbers 
  340. are different. The reverse can also happen: several domain names can all 
  341. belong to the same numerical address. If you use the dig command on each 
  342. link in the route to DAISY.EE.UND.AC.ZA, youÆll find a tremendous 
  343. variation in whether the routers map to same or different domain names. 
  344. As hackers, we want to get wise to all these variations in how domain 
  345. names are associated with boxes.
  346. But we can still learn even more about that Cisco router named 
  347. CISCO-UNP.UND.AC.ZA. We go back to nslookup and run it in interactive 
  348. mode:
  349. ->/usr/etc/nslookup
  350. Default Server: swcp.com
  351. Address: 198.59.115.2
  352. >
  353. Now letÆs do something new with nslookup. This is a command that comes 
  354. in really, really handy when weÆre playing vigilante and need to 
  355. persecute a spammer or bust a child porn Web site or two. HereÆs how we 
  356. can get the email address for the sysadmin of an Internet host computer.
  357. > set type=soa
  358. Then I enter the name of the computer about which I am curious. Note 
  359. that I put a period after the end of the host name. It often helps to do 
  360. this with nslookup:
  361. > CISCO-UNP.UND.AC.ZA.
  362. Server: swcp.com
  363. Address: 198.59.115.2
  364. *** No start of authority zone information is available for 
  365. CISCO-UNP.UND.AC.ZA.
  366. Now what do I do? Give up? No, IÆm a hacker wannabe, right? So I try 
  367. entering just part of the domain name, again remembering to put a period 
  368. at the end:
  369. > und.ac.za.
  370. Server: swcp.com
  371. Address: 198.59.115.2
  372. und.ac.za origin = Eagle.und.ac.za
  373. mail addr = postmaster.und.ac.za
  374. serial=199610255, refresh=10800, retry=3600, expire=3000000, min=86400
  375. Eagle.und.ac.za inet address = 146.230.128.15
  376. Shrike.und.ac.za inet address = 146.230.128.13
  377. ucthpx.uct.ac.za inet address = 137.158.128.1
  378. hiPPo.ru.ac.za inet address = 146.231.128.1
  379. Rain.psg.com inet address = 147.28.0.34
  380. Bingo!!! I got the email address of a sysadmin whose domain includes 
  381. that Cisco router, AND the IP addresses of some other boxes he or she 
  382. administers. But notice it doesnÆt list any of those routers which the 
  383. sysadmin undoubtedly knows a thing or two about.
  384. But we arenÆt done yet with cisco-unp.und.ac.za (146.230.128.8). Of 
  385. course we have a pretty good guess that it is a Cisco router. But why 
  386. stop with a mere guess when we can port surf? So we fall back on our 
  387. friend the telnet program and head for port 2001:
  388. ->telnet 146.230.128.8 2001
  389. Trying 146.230.128.8 ...
  390. Connected to 146.230.128.8.
  391. Escape character is '^]'.
  392. C
  393. ****************************************************
  394. *** Welcome to the University of Natal ***
  395. *** ***
  396. *** Model : Cisco 4500 with ATM and 8 BRI ports ***
  397. *** ***
  398. *** Dimension Data Durban - 031-838333 ***
  399. *** ***
  400. ***************************************************
  401. Hey, we know now that this is a Cisco model 4500 owned by the University 
  402. of Natal, and we even got a phone number for the sysadmin. From this we 
  403. also can infer that this router handles a subnet which serves the U of 
  404. Natal and includes daisy.
  405. But why did I telnet to port 2001? ItÆs in common use among routers as 
  406. the administrative port. How do I know that? From the RFC (request for 
  407. comments) that covers all commonly used port assignments. You can find a 
  408. copy of this RFC at http://ds2.internic.net/rfc/rfc1700.txt. Read it and 
  409. youÆll be in for some happy port surfing!
  410. ************************
  411. Evil Genius tip: there are a bunch of ports used by Cisco routers:
  412. cisco-fna 130/tcp cisco FNATIVE
  413. cisco-tna 131/tcp cisco TNATIVE
  414. cisco-sys 132/tcp cisco SYSMAINT
  415. licensedaemon 1986/tcp cisco license management
  416. tr-rsrb-p1 1987/tcp cisco RSRB Priority 1 port
  417. tr-rsrb-p2 1988/tcp cisco RSRB Priority 2 port
  418. tr-rsrb-p3 1989/tcp cisco RSRB Priority 3 port
  419. stun-p1 1990/tcp cisco STUN Priority 1 port
  420. stun-p2 1991/tcp cisco STUN Priority 2 port
  421. stun-p3 1992/tcp cisco STUN Priority 3 port
  422. snmp-tcp-port 1993/tcp cisco SNMP TCP port
  423. stun-port 1994/tcp cisco serial tunnel port
  424. perf-port 1995/tcp cisco perf port
  425. tr-rsrb-port 1996/tcp cisco Remote SRB port
  426. gdp-port 1997/tcp cisco Gateway Discovery Protocol
  427. x25-svc-port 1998/tcp cisco X.25 service (XOT)
  428. tcp-id-port 1999/tcp cisco identification port
  429. ************************
  430. But what about the ônormalö telnet port, which is 23? Since it is the 
  431. ônormalö port, the one you usually go to when you want to log in, we 
  432. donÆt need to put the 23 after the host name:
  433. ->telnet 146.230.128.8
  434. Trying 146.230.128.8 ...
  435. Connected to 146.230.128.8.
  436. Escape character is '^]'.
  437. C
  438. ************************************************************************
  439. *
  440. *** Welcome to the University of Natal ***
  441. *** ***
  442. *** Model : Cisco 4500 with ATM and 8 BRI ports ***
  443. *** ***
  444. *** Dimension Data Durban - 031-838333 ***
  445. *** ***
  446. ************************************************************************
  447. *
  448. User Access Verification
  449. Password:
  450. Hey, this is interesting, no username requested, just a password. If I 
  451. were the sysadmin, IÆd make it a little harder to log in. Hmmm, what 
  452. happens if I try to port surf finger that site? That means telnet to the 
  453. finger port, which is 79:
  454. ->telnet 146.230.128.8 79
  455. Trying 146.230.128.8 ...
  456. Connected to 146.230.128.8.
  457. Escape character is '^]'.
  458. C
  459. ************************************************************************
  460. *
  461. *** Welcome to the University of Natal ***
  462. *** ***
  463. *** Model : Cisco 4500 with ATM and 8 BRI ports ***
  464. *** ***
  465. *** Dimension Data Durban - 031-838333 ***
  466. *** ***
  467. ************************************************************************
  468. *
  469. Line User Host(s) Idle Location
  470. * 2 vty 0 idle 0 kitsune.swcp.com
  471. BR0:2 Sync PPP 00:00:00
  472. BR0:1 Sync PPP 00:00:00
  473. BR1:2 Sync PPP 00:00:00
  474. BR1:1 Sync PPP 00:00:00
  475. BR2:2 Sync PPP 00:00:01
  476. BR2:1 Sync PPP 00:00:00
  477. BR5:1 Sync PPP 00:00:00
  478. Connection closed by foreign host.
  479. Notice that finger lists the connection to the computer I was port 
  480. surfing from: kitsune. But no one else seems to be on line just now. 
  481. Please remember, when you port surf, unless you know how to do IP 
  482. spoofing, your target computer knows where you came from. Of course I 
  483. will be a polite guest.
  484. Now letÆs try the obvious. LetÆs telnet to the login port of daisy. I 
  485. use the numerical address just for the heck of it:
  486. ->telnet 146.230.192.18
  487. Trying 146.230.192.18 ...
  488. Connected to 146.230.192.18.
  489. Escape character is '^]'.
  490. NetBSD/i386 (daisy.ee.und.ac.za) (ttyp0)
  491. login:
  492. Hey, this is interesting. Since we now know this is a university, thatÆs 
  493. probably the electrical engineering (EE) department. And NetBSD is a 
  494. freeware Unix that runs on a PC! Probably a 80386 box. 
  495. Getting this info makes me almost feel like IÆve been hanging out at the 
  496. University of Natal EE computer lab. It sounds like a friendly place. 
  497. Judging from their router, security is somewhat lax, they use cheap 
  498. computers, and messages are friendly. LetÆs finger and see whoÆs logged 
  499. in just now:
  500. Since I am already in the telnet program (I can tell by the prompt 
  501. ôtelnet>ô), I go to daisy using the ôopenö command:
  502. telnet> open daisy.ee.und.ac.za 79
  503. Trying 146.230.192.18 ...
  504. telnet: connect: Connection refused
  505. telnet> quit
  506. Well, that didnÆt work, so I exit telnet and try the finger program on 
  507. my shell account computer:
  508. ->finger @daisy.ee.und.ac.za
  509. [daisy.ee.und.ac.za]
  510. finger: daisy.ee.und.ac.za: Connection refused
  511. Sigh. ItÆs hard to find open finger ports any more. But itÆs a good 
  512. security practice to close finger. Damien Sorder points out, ôIf you 
  513. install the new Linux distributions, it comes with Cfingerd. Why would I 
  514. (and others) want to shut it down? Not because of hackers and abuse or 
  515. some STUPID S*** like that. Because it gives out way too much 
  516. information when you finger a single user. You get machine load and all 
  517. the user information.ö
  518. I manage to pull up a little more info on how to map the 
  519. interconnections of University of Natal computers with an search of the 
  520. Web using http://digital.altavista.com. It links me to the site 
  521. http://www.frd.ac.za/uninet/sprint.html, which is titled ôTraffic on the 
  522. UNINET-SPRINTLINK Link.ö However, all the links to netwrok traffic 
  523. statistics from that site are dead.
  524. Next, letÆs look into number 20 on that traceroute that led us to the 
  525. University of Natal. You can pretty much expect that links in the middle 
  526. of a long traceroute will be big computers owned by the bigger companies 
  527. that form the backbone of the Internet.
  528. ->telnet 155.232.82.2 2001
  529. Trying 155.232.82.2 ...
  530. Connected to 155.232.82.2.
  531. Escape character is '^]'.
  532. Id: und02
  533. Authorised Users Only!
  534. ------------------------
  535. User Access Verification
  536. Username:
  537. Yup, weÆre out of friendly territory now. And since port 2001 works, it 
  538. may be a router. Just for laughs, though, letÆs go back to the default 
  539. telnet port:
  540. ->telnet 155.232.82.2
  541. Trying 155.232.82.2 ...
  542. Connected to 155.232.82.2.
  543. Escape character is '^]'.
  544. Id: und02
  545. Authorised Users Only!
  546. ------------------------
  547. User Access Verification
  548. Username:
  549. Now just maybe this backbone-type computer will tell us gobs of stuff 
  550. about all the computers it is connected to. We try telneting to the 
  551. netstat port, 15. This, if it happens to be open to the public, will 
  552. tell us all about the computers that connect through it:
  553. ->telnet 155.232.82.2 15
  554. Trying 155.232.82.2 ...
  555. telnet: connect: Connection refused
  556. Sigh. I gave an example of the incredible wealth of information you can 
  557. get from netstat on the GTMHH on port surfing. But every day it is 
  558. harder to find a public netstat port. ThatÆs because the information 
  559. netstat gives is so useful to computer criminals. In fact, port 15 is no 
  560. longer reserved as the netstat port (as of 1994, according to the RFC). 
  561. So you will find few boxes using it. 
  562. ******************************
  563. Newbie note: want to know what port assignments your ISP uses? Sorder 
  564. points out ô /etc/services on most machines will [tell you this].ö
  565. How can you can read that information? Try this:
  566. First, change to the /etc/ directory:
  567. ->cd /etc
  568. Then command it to print it out to your screen with:
  569. ->more services
  570. #
  571. # @(#)services 1.16 90/01/03 SMI
  572. #
  573. # Network services, Internet style
  574. # This file is never consulted when the NIS are running
  575. #
  576. tcpmux 1/tcp # rfc-1078
  577. echo 7/tcp
  578. ... and so on...
  579. Alas, just because your shell account has a list of port assignments 
  580. doesnÆt mean they are actually in use. It also probably wonÆt list 
  581. specialized services like all those Cisco router port assignments.
  582. *************************
  583. In fact, after surfing about two dozen somewhat randomly chosen netstat 
  584. ports, the only answer I get other than ôConnection refusedö is:
  585. ->telnet ns.nmia.com 15
  586. Trying 198.59.166.10 ...
  587. Connected to ns.nmia.com.
  588. Escape character is '^]'.
  589. Yes, but will I see the EASTER BUNNY in skintight leather
  590. at an IRON MAIDEN concert?
  591. Now what about all those Sprintlink routers in that traceroute? ThatÆs a 
  592. major Internet backbone based in the US provided by Sprint. You can get 
  593. some information on the topology of the Sprintlink backbone at 
  594. http://www.sprintlink.net/SPLK/HB21.html#2.2. Alas, Sprintlink used to 
  595. give out much more information than they do today. All I can pick up on 
  596. their Web site today is pretty vague. 
  597. Sigh. The Internet is getting less friendly, but more secure. Some day 
  598. when weÆre really ancient, say five years from now, weÆll be telling 
  599. people, ôWhy, I remember when we could port surf! Why, there used to be 
  600. zillions of open ports and people could choose ANY password they wanted. 
  601. Hmph! Today itÆs just firewalls everywhere you look!ö Adds Sorder, ôGee. 
  602. How do you think people like me feel.. port surfing over 6 years ago.ö
  603. Our thanks to Damien Sorder (jericho@dimensional.com) for assistance in 
  604. reviewing and contributing to this GTMHH.
  605. _________________________________________________________
  606. Want to see back issues of Guide to (mostly) Harmless Hacking? See 
  607. either http://www.tacd.com/zines/gtmhh/ or 
  608. http://ra.nilenet.com/~mjl/hacks/codez.htm or
  609. http://www3.ns.sympatico.ca/loukas.halo8/HappyHacker/
  610. Subscribe to our email list by emailing to hacker@techbroker.com with 
  611. message "subscribe" or join our Hacker forum at 
  612. http://www.infowar.com/cgi-shl/login.exe.
  613. Want to share some kewl stuph with the Happy Hacker list? Correct 
  614. mistakes? Send your messages to hacker@techbroker.com. To send me 
  615. confidential email (please, no discussions of illegal activities) use 
  616. cmeinel@techbroker.com and be sure to state in your message that you 
  617. want me to keep this confidential. If you wish your message posted 
  618. anonymously, please say so! Please direct flames to 
  619. dev/null@techbroker.com. Happy hacking! 
  620. Copyright 1997 Carolyn P. Meinel. You may forward or post on your Web 
  621. site this GUIDE TO (mostly) HARMLESS HACKING as long as you leave this 
  622. notice at the end..
  623. ________________________________________________________